import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import IndexView from "@/views/IndexView.vue";

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/notice',
    children:[
      {path: '/garbage', component: () => import('../views/garbage/GarbageView.vue')},
      {path: '/notice', component: () => import('../views/notice/NoticeView.vue')},
      {path: '/points', component: () => import('../views/user/PointsView.vue')},
      {path: '/log', component: () => import('../views/user/LogView.vue')},
    ]
  },
  {
    path: '/index',
    component: IndexView,
    redirect: '/user',
    children: [
      {path: '/garbage1', component: () => import('../views/garbage/GarbageView1.vue')},
      {path: '/notice1', component: () => import('../views/notice/NoticeView1.vue')},
      {path: '/points1', component: () => import('../views/user/PointsView1.vue')},
      {path: '/changePwd', component: () => import('../views/user/ChangePasswordView.vue')},
      {path: '/user', component: () => import('../views/user/UserView.vue')},
      {path: '/put', component: () => import('../views/user/PutView.vue')},
    ]
  },

  {path: '/login', component: () => import('../views/LoginView.vue')},
  {path: '/adminNotice', component: () => import('../views/admin/AdminNoticeView.vue')},
  {path: '/admin', component: () => import('../views/admin/AdminView.vue')},
  {path: '/adminGarbage', component: () => import('../views/admin/AdminGarbageView.vue')},
  {path: '/adminUser', component: () => import('../views/admin/AdminUserView.vue')},
  {path: '/adminPut', component: () => import('../views/admin/AdminPutView.vue')},
]
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
